package com.bhs.sansonglogistics.bean;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface DriverDao {

    @Query("SELECT * FROM driver WHERE plateNumber LIKE :value || '%' order by  plateNumber desc limit 0,10")
    List<Driver> getAllDriver(String value);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(Driver... drivers);

    @Update
    void update(Driver... drivers);

    @Delete
    void delete(Driver... drivers);
}
